package com.kws.system.controller.customerService;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kws.common.core.domain.R;
import com.kws.system.domain.info.QueryChatReplyInfo;
import com.kws.system.domain.info.QueryCustomerServiceConsultInfo;
import com.kws.system.domain.vo.QueryCustomerServiceConsultRq;
import com.kws.system.service.CustomerServiceConsultService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <b>CustomerServiceConsultController</b>
 *
 * @description: CustomerServiceConsultController <br>
 * @date: 2024/12/6 11:19 <br>
 * @author: lhm <br>
 * @version: 1.0 <br>
 */

@Api(tags = "客服咨询管理")
@RestController
public class CustomerServiceConsultController {
    private static final Logger logger = LoggerFactory.getLogger(CustomerServiceConsultController.class);

    @Autowired
    private CustomerServiceConsultService customerServiceConsultService;

    @ApiOperation("分页查询客服咨询列表")
    @PostMapping("/query/customerServiceConsult/page")
    public R<Page<QueryCustomerServiceConsultInfo>> queryCustomerServiceConsultPage(@RequestBody QueryCustomerServiceConsultRq rq){
        Page<QueryCustomerServiceConsultInfo> pageIno = customerServiceConsultService.queryCustomerServiceConsultPage(rq);
        return R.ok(pageIno);
    }


    @ApiOperation("回复-分页查询聊天内容")
    @GetMapping("/query/chatReply/list")
    public R<Page<QueryChatReplyInfo>> queryChatReplyList(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
                                                          @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
        Page<QueryChatReplyInfo> pageInfo = customerServiceConsultService.queryChatReplyList(pageNum,pageSize);
        return R.ok(pageInfo);
    }
}
